<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var num1 = parseFloat(prompt('请输入第一个值'));
    var num2 = parseFloat(prompt('请输入第二个值'));
    function getMax () {
        if (num1 > num2){
            alert(num1);
            return;
        }else {
            return alert(num2);
            return;
        }
    }
    alert(getMax());
</script>
<body>

</body>
</html>